Skip to content

Apply best practices - #76

Merged
sreichl merged 5 commits into
mainfrom
hoferand/best-practices
Mar 13, 2026
Merged

Apply best practices#76
sreichl merged 5 commits into
mainfrom
hoferand/best-practices

Conversation

@hoferand

@hoferand hoferand commented Mar 10, 2026

Copy link
Copy Markdown
Collaborator

For local formatting the following commands can be used:

Markdown/YAML:

npx prettier . --write

Snakemake:

snakefmt .

Python:

black .

R:

Rscript -e 'install.packages("styler", repos = "https://cloud.r-project.org")' # Only necessary once
Rscript -e 'styler::style_dir(".")'

Comment thread workflow/envs/clusterCrit.yaml
@hoferand

Copy link
Copy Markdown
Collaborator Author

I enabled all kinds of analyzes in the config file that I found, and it still works (on my machine 😅) => ready for review and merge

jfi: I also played with codex to automatically configure the workflow with prompts like i only need PCA, can you disable the rest? only edit the config file and it worked pretty well 🔥

@hoferand
hoferand marked this pull request as ready for review March 13, 2026 10:42
@sreichl
sreichl merged commit 1cdaefd into main Mar 13, 2026
4 checks passed
@sreichl

sreichl commented Mar 13, 2026

Copy link
Copy Markdown
Collaborator

merged assuming complete testing and only linting related changes

@sreichl

sreichl commented Mar 16, 2026

Copy link
Copy Markdown
Collaborator

I enabled all kinds of analyzes in the config file that I found, and it still works (on my machine 😅) => ready for review and merge

This contradicts your statement about the ClusterCrit package not being available for macOS. So either it is available and you tested its functionality, or it is not available and you couldn't have tested it. Please comment.

Also, I quickly checked, and at least on conda-forge, there is a macOS version (actually all three platforms are supported). Please comment as well on that.
https://anaconda.org/channels/conda-forge/packages/r-clustercrit/overview

@hoferand

hoferand commented Mar 16, 2026

Copy link
Copy Markdown
Collaborator Author

1)

Codex used a dirty workaround making it working on my machine, it added an inline library fetch in validation_internal.R:

ensure_clusterCrit <- function() {
  if (requireNamespace("clusterCrit", quietly = TRUE)) {
    return(invisible(TRUE))
  }

  primary_lib <- .libPaths()[1]
  lock_dir <- file.path(primary_lib, "00LOCK-clusterCrit-codex")

  while (!dir.create(lock_dir, showWarnings = FALSE)) {
    if (requireNamespace("clusterCrit", quietly = TRUE)) {
      return(invisible(TRUE))
    }
    Sys.sleep(2)
  }

  on.exit(unlink(lock_dir, recursive = TRUE, force = TRUE), add = TRUE)

  install.packages(
    "clusterCrit",
    repos = "https://cloud.r-project.org",
    lib = primary_lib,
    quiet = TRUE
  )

  if (!requireNamespace("clusterCrit", quietly = TRUE)) {
    stop("Failed to install the CRAN package 'clusterCrit'.")
  }
}

ensure_clusterCrit()

But via conda envs it wasn't/isn't possible.

2)

Yeah, it is available on macOS (as well as Linux and Windows), but only for x86-64 CPUs. All new MacBooks use the ARM64 architecture, that’s the problem.

@sreichl

sreichl commented Mar 16, 2026

Copy link
Copy Markdown
Collaborator

Okay, understood. Thanks.

@sreichl
sreichl deleted the hoferand/best-practices branch March 24, 2026 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants